home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Easy 2010 May
/
Mac Life Ubuntu.iso
/
casper
/
filesystem.squashfs
/
usr
/
share
/
python-support
/
python-rdflib
/
rdflib
/
syntax
/
serializers
/
AbstractSerializer.py
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Python Source
|
2007-04-04
|
457 b
|
19 lines
from rdflib import URIRef
class AbstractSerializer(object):
def __init__(self, store):
self.store = store
self.encoding = "UTF-8"
self.base = None
def serialize(self, stream, base=None, encoding=None, **args):
"""Abstract method"""
def relativize(self, uri):
base = self.base
if base is not None and uri.startswith(base):
uri = URIRef(uri.replace(base, "", 1))
return uri